var utils = require("../utils/utils");
var ocr_utils = require("../utils/ocr_utils");
var in_task = require("./inTask");
var ad = require("./ad");
var point_map = require("./pointMap");
var example = {
  go_page_from_home() {
    if (utils.exists_text("视频") && utils.exists_text("小说")) {
      console.log("example:go_page_from_home");
      utils.click_point.apply(
        utils,
        utils.get_size_point(point_map["首页任务"])
      );
      sleep(2 * 1000);
      this.init();
    } else {
      console.log("example:go_page_from_home: NOT FOUND");
    }
  },
  init() {
    var ui_text = utils.click_text("开宝箱得金币");
    if (ui_text) {
      console.log("example init: 找到【开宝箱得金币】");
      sleep(2 * 1000);
      this.run();
    } else {
      console.log("example init: 没找到【开宝箱得金币】");
    }
  },
  run() {
    in_task.init(null, null, null, null, null, null, 3);
    this.next();
  },
  after() {
    console.log("example after");
    this.next();
  },
  next() {
    console.log("example next");
  },
};
module.exports = example;
